package com.itheima.observer.demo;

/**
 * @author zzw
 * @date 2025/10/25
 * @description 具体被观察者类（小偷）
 */
public class Thief extends Subject {
    private String name;

    public Thief(String name) {
        this.name = name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void steal() {
        System.out.println("小偷：" + name + " 我偷东西了，有没有人来抓我！！！");
        setChanged();
        notifyObservers();
    }
}
